import { my_request } from '@/utils/http'

import type {
  HotPanelItem,
  BannerItem,
  CategoryItem,
  GuessLikeItem,
  HotParams,
  HotResult,
  SubType,
} from '@/types/home'
import type { PageParams, PageResult } from '@/types/global'

export const getHomeBannerAPI = (distributionSite = 1) => {
  return my_request<BannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite,
    },
  })
}

export const getHomeCategoryAPI = () => {
  return my_request<CategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}

export const getHotPanelAPI = () => {
  return my_request<HotPanelItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}

export const getguessLikeAPI = (data: PageParams = { page: 1, pageSize: 10 }) => {
  return my_request<PageResult<GuessLikeItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}

export const getHotRecommendAPI = (url: string, data?: HotParams) => {
  return my_request<HotResult>({
    method: 'GET',
    url,
    data,
  })
}
